|
EPD Extension Kit for MSP430 LaunchPad
|
The functions of working with flash memory. More...
#include "Mem_Flash.h"Functions | |
| void | Flash_cs_high (void) |
| Set Flash_CS pin to high and EPD_CS to low. | |
| void | Flash_cs_low (void) |
| Set EPD_CS to high and Flash_CS to low. | |
| void | Flash_init (void) |
| uint8_t | is_flash_existed (void) |
| Check the flash memory of EPD extension board is existed or not in order to determine the board is connected. More... | |
| void | CMD_SE (long flash_address) |
| Erase the data of the chosen sector (4KB) to be "1". More... | |
| void | CMD_CE (void) |
| Erase all of the flash memory. | |
| void | read_flash (long flash_address, uint8_t *target_buffer, uint8_t byte_length) |
| Read Flash data into buffer. More... | |
| void | write_flash (long flash_address, uint8_t *source_address, uint8_t byte_length) |
| Write Flash data from buffer. More... | |
| void | erase_image (long address, uint8_t EPD_size) |
| To erase the image data. More... | |
| long | get_slideshow_image_address (uint8_t EPD_size, uint8_t image_index, uint8_t is_clear) |
| Get the slideshow image address and clear the image or not. More... | |
| long | get_custom_image_address (uint8_t EPD_size, uint8_t image_index, uint8_t is_clear) |
| Get the custom image address and clear the image or not. More... | |
| long | get_flash_mark_image_info (uint8_t EPD_size) |
| Get mark image information from flash. More... | |
| void | get_flash_image_info (image_information_t *image_info) |
| Get image information from flash. More... | |
| void | write_mark (long address) |
| Write image header to flash. More... | |
| void | write_ascii (long canvas_address, long mark_address, uint16_t coordinate_X, uint16_t coordinate_Y, char *Text) |
| Write ASCII data to canvas image of flash. More... | |
| void | write_slideshow_parameters (slideshow_information_t *slideshow_info) |
| Update slideshow parameters. More... | |
| void | read_slideshow_parameters (slideshow_information_t *slideshow_info) |
| Read slideshow parameters from defined Flash segment. More... | |
The functions of working with flash memory.
Copyright (c) 2012-2013 Pervasive Displays Inc. All rights reserved.
Authors: Pervasive Displays Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
| void CMD_SE | ( | long | flash_address | ) |
Erase the data of the chosen sector (4KB) to be "1".
| flash_address | 32 bit flash memory address |
| void erase_image | ( | long | address, |
| uint8_t | EPD_size | ||
| ) |
To erase the image data.
| address | The start address to be erased |
| EPD_size | The EPD size |
| long get_custom_image_address | ( | uint8_t | EPD_size, |
| uint8_t | image_index, | ||
| uint8_t | is_clear | ||
| ) |
Get the custom image address and clear the image or not.
| EPD_size | The EPD size |
| image_index | The current image index to show |
| is_clear | Whether to clear custom images |
number of maximum custom images = 8
To erase custom image
| void get_flash_image_info | ( | image_information_t * | image_info | ) |
Get image information from flash.
| image_info | The data structure of image information |
| long get_flash_mark_image_info | ( | uint8_t | EPD_size | ) |
Get mark image information from flash.
| EPD_size | The EPD size |
| long get_slideshow_image_address | ( | uint8_t | EPD_size, |
| uint8_t | image_index, | ||
| uint8_t | is_clear | ||
| ) |
Get the slideshow image address and clear the image or not.
| EPD_size | The EPD size |
| image_index | The current image index to show |
| is_clear | Whether to clear slideshow images |
number of maximum slideshow images = 4
To erase slideshow image
Read image mark offset byte to IsExit
| uint8_t is_flash_existed | ( | void | ) |
Check the flash memory of EPD extension board is existed or not in order to determine the board is connected.
Chip select go low to start a flash command
Send command to check the Electronic ID of Flash
Chip select go high to end a flash command
| void read_flash | ( | long | flash_address, |
| uint8_t * | target_buffer, | ||
| uint8_t | byte_length | ||
| ) |
Read Flash data into buffer.
| flash_address | The start address of Flash |
| target_buffer | The target address of buffer will be read |
| byte_length | The data length will be read |
| void read_slideshow_parameters | ( | slideshow_information_t * | slideshow_info | ) |
Read slideshow parameters from defined Flash segment.
| slideshow_info | The structure of slideshow information |
Read parameters from address
< Do while the data byte is empty
< Forward two data length is the last saved position of parameter address
| void write_ascii | ( | long | canvas_address, |
| long | mark_address, | ||
| uint16_t | coordinate_X, | ||
| uint16_t | coordinate_Y, | ||
| char * | Text | ||
| ) |
Write ASCII data to canvas image of flash.
| canvas_address | The canvas image address |
| mark_address | The mark image address |
| coordinate_X | The location of horizontal of inputted string |
| coordinate_Y | The location of vertical of inputted string |
| Text | The pointer of inputted string |
Get mark and canvas image address
Get ASCII character data and save to Text_array
write Text_array to Canvas memory
write mark memory
| void write_flash | ( | long | flash_address, |
| uint8_t * | source_address, | ||
| uint8_t | byte_length | ||
| ) |
Write Flash data from buffer.
| flash_address | 32 bit flash memory address |
| source_address | The source address of buffer will be written |
| byte_length | The data length will be read |
| void write_mark | ( | long | address | ) |
Write image header to flash.
| address | The image address |
| void write_slideshow_parameters | ( | slideshow_information_t * | slideshow_info | ) |
Update slideshow parameters.
| slideshow_info | The pointer address of slideshow information |
1.8.3.1